﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Data.SqlClient;
using Adex;
using Telerik.Web.UI;
using SubSonic.Sugar;
using System.Security;
using MediaMonitor.Common;
using Ionic.Zip;
using System.IO;
using OfficeOpenXml;
using OfficeOpenXml.Style;
using System.Drawing;
using OfficeOpenXml.Drawing.Chart;



using Telerik.Charting;
using Telerik.Charting.Styles;
using System.Transactions;
using System.Web.UI.HtmlControls;
using System.Collections;
using System.Configuration;
using SubSonic;

namespace MediaMonitor.Users
{
    public partial class all_newsalertLast : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Request.QueryString["code"].ToString() != "")
            {
                if (Request.QueryString["code"].ToString() != "last")
                {
                    imgHead.ImageUrl = "../images/" + Request.QueryString["code"].ToString() + "-head.jpg";
                }
                else {
                    imgHead.ImageUrl = "../images/media-head.jpg";
                }
                DataTable dt = SPs.NewaAlertLast(Session["Company"].ToString(), Request.QueryString["code"].ToString()).GetDataSet().Tables[0];
                if (dt.Rows.Count > 0)
                {
                    RadListView1.DataSource = dt;
                    RadListView1.DataBind();
                    lblNoRecord.Visible = false;
                }
                else {
                    RadListView1.Visible = false;
                    lblNoRecord.Visible = true;
                    lblNoRecord.Text = "No Record Found";
                }
            }
        }
        protected void cmbPageSize_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            RadListView1.PageSize = int.Parse(e.Value);
            RadListView1.CurrentPageIndex = 0;
            RadListView1.Rebind();
        }
        public bool ifTrue(object val)
        {
            return (val == null) ? false : val.ToString().Equals("TV");

        }
        public bool ifPreshTrue(object val)
        {
            return (val == null) ? false : val.ToString().Equals("Press");

        }
        public bool ifRadioTrue(object val)
        {
            return (val == null) ? false : val.ToString().Equals("Radio");

        }
        public bool ifInternetTrue(object val)
        {
            return (val == null) ? false : val.ToString().Equals("Internet");

        }
    }
}